﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Li.Repository.IRepository;
using Li.Service.IService;
namespace Li.Service.Service
{
    public class BaseService<T> : IBaseService<T> where T : class, new()
    {
        protected IBaseRepository<T> _baseRepository;
        public BaseService(IBaseRepository<T> baseRepository)
        {
            _baseRepository = baseRepository;
        }
        public void Add(T entity)
        {
            _baseRepository.Add(entity);
        }

        public int Commit()
        {
           return _baseRepository.Commit();
        }

        public void Delete(T entity)
        {
            _baseRepository.Delete(entity);
        }

        public IQueryable<T> GetAll()
        {
            return _baseRepository.GetAll();
        }

        public void RemoveRange(List<T> all)
        {
            _baseRepository.RemoveRange(all);
        }
    }
}
